1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a video data display, and more particularly, to a method and apparatus for displaying video data without a display delay that occurs in a video decoder that cannot detect an end of picture.
2. Description of the Related Art
Video decoders conventionally display a decoded picture by detecting a header of a next picture or by detecting a code indicating an end of stream (e.g., sequence end code (SED)/end of sequence (EOS)) rather than the end of picture. The term of SEC/EOS indicates the end of stream, where the SEC is used in the moving picture experts group (MPEG)-1/2 video data standards, and the EOS is used in the video codec (VC)-1 video data standard or the H.264 video data standard.
The reason why the video decoders operate as described above is that the end of the picture cannot be easily detected from a video elementary stream (ES). In general, video data is continuously displayed in response to a picture start code if one stream that amounts to tens of hours is continuously displayed. However, in some cases, for example, when a menu screen composed of one picture is used, or when a stream having a large video gap is used such as a slideshow application, decoded video data stored in a buffer cannot be displayed.
Accordingly, a display delay occurs when a time for displaying a picture on a screen is significantly different from a presentation time stamp (PTS) value of the picture. In general, the PTS value is allocated to respective pictures which are completed by combining one or more video streams.
FIG. 1 is a block diagram of a conventional apparatus for displaying an MPEG-2 transport stream (TS).
Referring to FIG. 1, the apparatus includes a de-multiplexer 110, a decoder 120, a decoding buffer selector 130, a video buffer 140, a display buffer selector 150, and a video display 160.
The de-multiplexer 110 receives the MPEG-2 TS. The received MPEG-2 TS is sequentially transmitted to the decoder 120 according to an arrival time stamp (ATS).
The decoder 120 decodes the video data received from the de-multiplexer 110, thereby completing one picture.
The decoding buffer selector 130 selects any one of buffers 141 to 14N included in the video buffer 140 to store the decoded video data. The display buffer selector 150 selects any one of the buffers 141 to 14N storing the video data to be displayed on a screen.
The video display 160 displays on the screen the video data stored in any one of the buffers 141 to 14N selected by the display buffer selector 150.
According to the prior art, when a header of a next picture or an SEC/EOS is detected, the decoder 120 increments by 1 a pointer of the decoding buffer selector 130 and a pointer of the display buffer selector 150 so that the pointer of the display buffer selector 150 indicates a buffer that stores a picture to be displayed next.
For example, if a picture currently being displayed on the screen is in association with video data stored in the first video buffer 141, the pointer of the decoding buffer selector 130 indicates the second video buffer 142, and the pointer of the display buffer selector 150 indicates the first video buffer 141. The decoder 120 decodes the video data and then stores the decoded video data in the second buffer 142 indicated by the pointer of the decoding buffer selector 130.
In this case, when the decoder 120 detects the head of picture or the SEC/EOS, the decoding buffer selector 130 increments its pointer by 1, thereby indicating the third buffer 143. The display buffer selector 150 also increments its pointer by 1, thereby indicating the second video buffer 142. As a result, the video data stored in the second video buffer 142 is displayed. That is, the decoded video data stored in the video buffers 141 to 14N is updated at a moment when these buffers are indicated by the pointer of the display buffer selector 150.
The display buffer selector 150 is sequentially synchronized with the decoding buffer selector 130 so that only a completely decoded picture is displayed on the screen. To this end, the pointer of the display buffer selector 150 has to be different by 1 from the pointer of the decoding buffer selector 130.
Referring to FIGS. 7A and 7B, when only a stream 720 included in an input stream 710 is displayed according to the prior art, the decoder 120 decodes a last video stream 722 included in the stream 720 to be displayed and then waits until a header of a next picture or an SEC/EOS is detected. Then, the decoded data, that is, the last video stream 722, is stored in the video buffer 140. Thus, the last video stream 722 is not displayed. That is, a display delay occurs in which certain video data is not displayed or is displayed with a time delay.
In order to implement a Blu-ray disc, which is one of applications of the present invention, a function is required whereby even a single picture can be timely displayed according to the PTS. However, since the conventional video decoder detects the header of the picture or the SEC/EOS rather than the end of picture, a display error occurs when the decoded picture is stored in a buffer and thus is not displayed on the screen for a certain period of time.
FIG. 2 illustrates an example of an MPEC-2 TS when a PTS difference between consecutive pictures is large.
Referring to FIG. 2, the MPEC-2 TS includes a first video stream 210, a second video stream 220, a third video stream 230, a fourth video stream 240, and an SEC/EOS 250. The PTS difference between the first video stream 210 and the second video stream 220 is significantly large. In this case, each stream may be used for a menu screen. That is, the respective streams of FIG. 2 are not continuously displayed but are used one by one as a separate menu screen.
For example, if a PTS value of the stream 210 to be used for a menu screen is 0x8000, an application reads only the stream 210 having a PTS value of 0x8000. In this case, the SEC/EOS 250 is not present behind the stream 210 having a PTS value of 0x8000. Immediately after data is read, the decoder 120 decodes the data and stores the data in the video buffer 140. The data is not displayed on a screen and rather remains in the video buffer 140 until the SEC/EOS 250 or a picture start code of a next picture is detected. Therefore, according to the prior art, a menu screen cannot be displayed when only a video decoder is used without any particular processing.
FIG. 3 illustrates an example of an MPEG-2 TS in which interactive graphic (IG) streams are present between a video stream and an SEC/EOS.
Referring to FIG. 3, the MPEG-2 TS includes a video stream 310, IG streams 320, 330, and 340, and an SEC/EOS 350.
Although the MPEG-2 TS is composed of one picture, the IG streams 320, 330, and 340 each having a significant data size are present between the SEC/EOS 350 and the video stream 310. In this case, as described above, the decoder 120 decodes video data immediately after the video data is received, and then stores the decoded video data in the video buffer 140. However, the stored video data is not displayed until a picture start code of the picture or the SEC/EOS 350 is detected.
Due to the appended IG streams 320, 330, and 340, the decoder 120 may detect the SEC/EOS 350 with a significant time delay. Such time delay may prevent the video data from being displayed according to an AV sync algorithm. Even if the video data is displayed, a display error may occur since a time for displaying the video data on the screen has a large discrepancy with respect to a PTS value of the picture.
As described above, the conventional video decoder detects a header of the picture or an SEC/EOS instead of an end of the picture. Thus, if a menu screen composed of one picture or a stream having a large video gap is displayed, or when only a part of an input stream is displayed, a display delay may occur when decoded video data stored in a buffer cannot be displayed.